package com.bwm.bwm007.main.fragment;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.bwm.bwm007.R;
import com.bwm.bwm007.main.activity.ShowPicActivity;
import com.bwm.bwm007.main.util.IBtnCallListener;

public class FragmentC extends Fragment implements View.OnClickListener, IBtnCallListener {

    private Button btn;
    IBtnCallListener ibtncalllistener;

    @Override
    public void onAttach(Activity activity) {
        ibtncalllistener = (IBtnCallListener) activity;
        super.onAttach(activity);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_c, container, false);
        initViews(view);
        return view;

    }

    private void initViews(View view) {
        btn = (Button) view.findViewById(R.id.btn);
        btn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()) {
            case R.id.btn:

                Intent intent = new Intent(getActivity(), ShowPicActivity.class);
                startActivity(intent);

                break;
            default:
                break;
        }
    }

    @Override
    public void transferMsg(String string) {
        Log.e("FragmentC", "transferMsg:" + string);
    }
}
